import QtQuick
import QtQuick.Controls
import QtQuick.Layouts

Page {
    title: "图片填充模式"
    
    Rectangle {
        anchors.fill: parent
        color: "#f0f0f0"

        GridLayout {
            anchors.centerIn: parent
            columns: 2
            rows: 3
            rowSpacing: 30
            columnSpacing: 30

            Column {
                Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
                spacing: 5
                Image {
                    width: 100; height: 100
                    source: "/images/logo.png"
                    fillMode: Image.Stretch
                }
                Text { text: "Stretch"; anchors.horizontalCenter: parent.horizontalCenter }
            }

            Column {
                Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
                spacing: 5
                Image {
                    width: 100; height: 100
                    source: "/images/logo.png"
                    fillMode: Image.PreserveAspectFit
                }
                Text { text: "PreserveAspectFit"; anchors.horizontalCenter: parent.horizontalCenter }
            }

            Column {
                Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
                spacing: 5
                Image {
                    width: 100; height: 100
                    source: "/images/logo.png"
                    fillMode: Image.PreserveAspectCrop
                }
                Text { text: "PreserveAspectCrop"; anchors.horizontalCenter: parent.horizontalCenter }
            }

            Column {
                Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
                spacing: 5
                Image {
                    width: 100; height: 100
                    source: "/images/logo.png"
                    fillMode: Image.Tile
                }
                Text { text: "Tile"; anchors.horizontalCenter: parent.horizontalCenter }
            }

            Column {
                Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
                spacing: 5
                Image {
                    width: 100; height: 100
                    source: "/images/logo.png"
                    fillMode: Image.TileVertically
                }
                Text { text: "TileVertically"; anchors.horizontalCenter: parent.horizontalCenter }
            }

            Column {
                Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
                spacing: 5
                Image {
                    width: 100; height: 100
                    source: "/images/logo.png"
                    fillMode: Image.TileHorizontally
                }
                Text { text: "TileHorizontally"; anchors.horizontalCenter: parent.horizontalCenter }
            }
        }
    }
} 
